#pragma once

//#include <srs_kernel_mp3.hpp>
#include <srs_core.hpp>

#if !defined(SRS_EXPORT_LIBRTMP)

#include <string>

class SrsStream;
class SrsFileWriter;

/**
* encode data to aac file.
*/
class SrsMp3Encoder {
private:
    SrsFileWriter* writer;
private:
    SrsStream* tag_stream;
public:
    SrsMp3Encoder();
    virtual ~SrsMp3Encoder();
public:
    /**
    * initialize the underlayer file stream.
    * @remark user can initialize multiple times to encode multiple mp3 files.
    * @remark, user must free the @param fw, mp3 encoder never close/free it.
    */
    virtual int initialize(SrsFileWriter* fw);
public:
    /**
    * write mp3 id3 v2.3 header.
    * @see mp3.id3v2.3.0.pdf, http://id3.org/id3v2.3.0
    */
    virtual int write_header();
    /**
    * write audio/video packet.
    * @remark assert data is not NULL.
    */
    virtual int write_audio(int64_t timestamp, char* data, int size);
};

#endif
